<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src='../../../JS/detailView.js'></script>
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<div>
					<table id="dg" style="width:100%;height:250px" singleSelect="true" fitColumns="true">
					</table>
				</div>
			</div>
		</div>
		<div id="toolbar"></div>
		<div id="dlg" class="easyui-dialog" closed="true" style="width:760px;height:560px;padding:0px">
			<iframe id="ifrmEdit" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>
		</div>
	</body>
	<script>
		var content = AddToolBar(35);
		$("#toolbar").append(content);
		$('#dg').datagrid({
			url: RemoteLinkAddress + '/logistics/warehousein/list.do',
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			rownumbers: 'true',
			autoRowHeight: 'true',
			fitColumns: 'false',
			height: 350,
			/*表格中的列名以及各自列名的ID*/
			columns: [
				[{
					field: 'ID',
					title: '入库单ID',
					width: '10%',
					align: 'center',
				}, {
					field: 'ORDER_NO',
					title: '入库单编号',
					width: '15%',
					align: 'center',

				}, {
					field: 'PURCHASEORDER_NO',
					title: '*采购单编号',
					width: '15%',
					align: 'center',

				}, 
				{
					field: 'PROVIDER_NAME',
					title: '*供应商',
					width: '15%',
					align: 'center',

				},{
					field: "STOREHOUSE_NAME",
					title: '仓库名',
					width: '15%',
					align: 'center',
				}, {
					field: "ISVERIFY",
					title: '审核状态',
					width: '18%',
					align: 'center',
					formatter: function(value, row, index) {
						return verifyStatus(value, false);
					}
				}, {
					field: "MEMO",
					title: '备注',
					width: '7%',
					align: 'center',
				}]
			],
			onDblClickRow: function(index, row) {
				editorWHI();
			}
		});

		function newdata() {
			var pLocation = "";
			pLocation = "UI/LOGISTICS/WareHouseSchedule/WareHouseScheduleSearch.html";
			AddTabIn("新增入库单", parent.parent.$("#tabs"), pLocation);
		}

		function editdata() {
			editorWHI();
		}

		function redodata() {
			var _url = RemoteLinkAddress + '/logistics/warehousein/list.do';
			$.ajax({
				dataType: "json",
				type: "get",
				url: _url,
				success: function(result) {
					if(result != null) {
						var _data = result;
						$('#dg').datagrid('loadData', _data);
					}
				},
				error: function(xhr, status, error) {
					$.messager.alert("错误", "请求失败!");
				}
			});
		}

		function editorWHI() {
			var row = $("#dg").datagrid("getSelected");
			if(!row) {
				$.messager.alert("警告", "没有选中数据");
			} else {
				var pLocation = "";
				pLocation = "UI/LOGISTICS/WareHouseScheduleProvider/WareHouseScheduleProviderAdd.html?WarehouseID=" + row.ID;
				AddTabIn("入库单单据明细", parent.parent.$("#tabs"), pLocation);
			}
		}
	</script>

</html>